<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Section 15.1.&nbsp; Introduction</title>
<link rel="STYLESHEET" type="text/css" href="images/style.css">
<link rel="STYLESHEET" type="text/css" href="images/docsafari.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch15.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch15lev1sec2.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
<br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"><a name="ch15lev1sec1"></a>
<h3 class="docSection1Title" id="454331-937">15.1. Introduction</h3>
<p class="docText"><a name="idd1e109549"></a><a name="idd1e109554"></a><a name="idd1e109559"></a><a name="idd1e109564"></a><a name="idd1e109567"></a><a name="idd1e109570"></a><a name="idd1e109575"></a><a name="idd1e109578"></a><a name="idd1e109583"></a>In <a class="docLink" href="ch08.html#ch08">Chapter 8</a>, we described the process control primitives and saw how to invoke multiple processes. But the only way for these processes to exchange information is by passing open files across a <tt>fork</tt> or an <tt>exec</tt> or through the file system. We'll now describe other techniques for processes to communicate with each other: IPC, or interprocess communication.</P>
<p class="docText">In the past, UNIX System IPC was a hodgepodge of various approaches, few of which were portable across all UNIX system implementations. Through the POSIX and The Open Group (formerly X/Open) standardization efforts, the situation has improved, but differences still exist. <a class="docLink" href="#ch15fig01">Figure 15.1</a> summarizes the various forms of IPC that are supported by the four implementations discussed in this text.</P>
<a name="ch15fig01"></a><p><table cellspacing="0" class="allBorders" border="1" RULES="groups" cellpadding="5"><caption><H5 class="docTableTitle">Figure 15.1. Summary of UNIX System IPC</H5></caption><colgroup><col width="150"><col width="75"><col width="75"><col width="75"><col width="75"><col width="75"></colgroup><thead><TR><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="middle"><p class="docText"><span class="docEmphRoman">IPC type</span></p></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="middle"><p class="docText"><span class="docEmphRoman">SUS</span></P></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">FreeBSD 5.2.1</span></P></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Linux 2.4.22</span></P></th><th class="rightBorder bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Mac OS X 10.3</span></p></th><th class="bottomBorder thead" scope="col" align="center" valign="top"><p class="docText"><span class="docEmphRoman">Solaris 9</span></P></th></tr></thead><TR><TD class="rightBorder" align="left" valign="top"><p class="docText">half-duplex pipes</P></td><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</P></td><TD class="rightBorder" align="center" valign="top"><p class="docText">(full)</P></td><td class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><td class="docTableCell" align="center" valign="top"><p class="docText">(full)</P></td></tr><tr><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">FIFOs</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><TD class="bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD></TR><TR><td class="rightBorder" align="left" valign="top"><p class="docText">full-duplex pipes</P></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">allowed</p></TD><td class="rightBorder" align="center" valign="top"><p class="docText">&#8226;,UDS</P></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">opt, UDS</p></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">UDS</p></TD><TD class="docTableCell" align="center" valign="top"><p class="docText">&#8226;, UDS</p></td></tr><tr><TD class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">named full-duplex pipes</p></TD><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">XSI option</P></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">UDS</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">opt, UDS</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">UDS</p></td><td class="bottomBorder" align="center" valign="top"><p class="docText">&#8226;, UDS</p></td></tr><tr><td class="rightBorder" align="left" valign="top"><p class="docText">message queues</p></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">XSI</p></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</P></td><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</P></TD><td class="rightBorder" align="center" valign="top">&nbsp;</TD><td class="docTableCell" align="center" valign="top"><p class="docText">&#8226;</P></TD></TR><tr><TD class="rightBorder" align="left" valign="top"><p class="docText">semaphores</P></td><TD class="rightBorder" align="center" valign="top"><p class="docText">XSI</P></td><td class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><td class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</P></td><td class="docTableCell" align="center" valign="top"><p class="docText">&#8226;</p></td></tr><tr><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">shared memory</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">XSI</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><TD class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><TD class="bottomBorder" align="center" valign="top"><p class="docText">&#8226;</P></td></TR><TR><TD class="rightBorder" align="left" valign="top"><p class="docText">sockets</p></TD><td class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</P></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></TD><TD class="rightBorder" align="center" valign="top"><p class="docText">&#8226;</p></td><td class="docTableCell" align="center" valign="top"><p class="docText">&#8226;</p></TD></tr><TR><td class="rightBorder bottomBorder" align="left" valign="top"><p class="docText">STREAMS</P></td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">XSI option</p></td><td class="rightBorder bottomBorder" align="center" valign="top">&nbsp;</td><td class="rightBorder bottomBorder" align="center" valign="top"><p class="docText">opt</p></td><td class="rightBorder bottomBorder" align="center" valign="top">&nbsp;</td><td class="bottomBorder" align="center" valign="top"><p class="docText">&#8226;</p></td></tr></table></p><br>
<p class="docText">Note that the Single UNIX Specification (the &quot;SUS&quot; column) allows an implementation to support full-duplex pipes, but requires only half-duplex pipes. An implementation that supports full-duplex pipes will still work with correctly written applications that assume that the underlying operating system supports only half-duplex pipes. We use &quot;(full)&quot; instead of a bullet to show implementations that support half-duplex pipes by using full-duplex pipes.</P>
<p class="docText">In <a class="docLink" href="#ch15fig01">Figure 15.1</a>, we show a bullet where basic functionality is supported. For full-duplex pipes, if the feature can be provided through UNIX domain sockets (<a class="docLink" href="ch17lev1sec3.html#ch17lev1sec3">Section 17.3</a>), we show &quot;UDS&quot; in the column. Some implementations support the feature with pipes and UNIX domain sockets, so these entries have both &quot;UDS&quot; and a bullet.</P>
<p class="docText">As we mentioned in <a class="docLink" href="ch14lev1sec4.html#ch14lev1sec4">Section 14.4</a>, support for STREAMS is optional in the Single UNIX Specification. Named full-duplex pipes are provided as mounted STREAMS-based pipes and so are also optional in the Single UNIX Specification. On <a name="idd1e109925"></a><a name="idd1e109928"></a><a name="idd1e109931"></a><a name="idd1e109934"></a><a name="idd1e109939"></a><a name="idd1e109942"></a><a name="idd1e109945"></a><a name="idd1e109948"></a><a name="idd1e109951"></a><a name="idd1e109954"></a><a name="idd1e109959"></a><a name="idd1e109962"></a><a name="idd1e109965"></a><a name="idd1e109968"></a><a name="idd1e109973"></a><a name="idd1e109978"></a><a name="idd1e109983"></a><a name="idd1e109986"></a><a name="idd1e109991"></a><a name="idd1e109996"></a><a name="idd1e109999"></a><a name="idd1e110004"></a>Linux, support for STREAMS is available in a separate, optional package called &quot;LiS&quot; (for Linux STREAMS). We show &quot;opt&quot; where the platform provides support for the feature through an optional packageone that is not usually installed by default.</p>
<p class="docText">The first seven forms of IPC in <a class="docLink" href="#ch15fig01">Figure 15.1</a> are usually restricted to IPC between processes on the same host. The final two rowssockets and STREAMSare the only two that are generally supported for IPC between processes on different hosts.</P>
<p class="docText">We have divided the discussion of IPC into three chapters. In this chapter, we examine classical IPC: pipes, FIFOs, message queues, semaphores, and shared memory. In the next chapter, we take a look at network IPC using the sockets mechanism. In <a class="docLink" href="ch17.html#ch17">Chapter 17</a>, we take a look at some advanced features of IPC.</P>

<UL></ul></TD></TR></table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/team.gif" width="60" height="17" border="0" align="absmiddle"  alt="Team BBL"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href=ch15.html><img src="images/prev.gif" width="60" height="17" border="0" align="absmiddle" alt="Previous Page"></a>
<a href=ch15lev1sec2.html><img src="images/next.gif" width="60" height="17" border="0" align="absmiddle" alt="Next Page"></a>
</div></td></tr></table>
</body></html><br>
<table width="100%" cellspacing="0" cellpadding="0"
style="margin-top: 0pt; border-collapse: collapse;"> 
<tr> <td align="right" style="background-color=white; border-top: 1px solid gray;"> 
<a href="http://www.zipghost.com/" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">The CHM file was converted to HTM by Trial version of <b>ChmD<!--34-->ecompiler</b>.</a>
</TD>
</TR><tr>
<td align="right" style="background-color=white; "> 
<a href="http://www.etextwizard.com/download/cd/cdsetup.exe" target="_blank" style="font-family: Tahoma, Verdana;
 font-size: 11px; text-decoration: none;">Download <b>ChmDec<!--34-->ompiler</b> at: http://www.zipghost.com</a>
</TD></tr></table>
